<template>
  <div class="alarm-table">
    <div class="table-header">
      <div style="width: 25%">告警类型</div>
      <div style="width: 30%">车牌号</div>
      <div style="width: 50%">告警时间</div>
    </div>
    <div class="table-body">
      <div class="table-row" v-for="(alarm, index) in alarms" :key="index">
        <div style="width: 25%">{{ alarm.type }}</div>
        <div style="width: 30%">{{ alarm.licensePlate }}</div>
        <div style="width: 50%">{{ alarm.time }}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue"
const alarms = ref([
  { type: "防拆卸告警", licensePlate: "川Z76SB7", time: "2024-09-21 10:30:00" },
  { type: "外出提醒", licensePlate: "川Z76SB8", time: "2024-09-21 10:31:00" },
  { type: "疑似无计划", licensePlate: "川Z76SB9", time: "2024-09-21 10:32:00" },
  { type: "异常姿态告警", licensePlate: "川Z76SB7", time: "2024-09-21 10:30:00" },
  { type: "疑似无计划", licensePlate: "川Z76SB8", time: "2024-09-21 10:31:00" },
  { type: "异常姿态告警", licensePlate: "川Z76SB9", time: "2024-09-21 10:32:00" },
  { type: "疑似无计划", licensePlate: "川Z76SB7", time: "2024-09-21 10:30:00" },
  { type: "异常姿态告警", licensePlate: "川Z76SB8", time: "2024-09-21 10:31:00" },
  { type: "防拆卸告警", licensePlate: "川Z76SB9", time: "2024-09-21 10:32:00" },
  { type: "异常姿态告警", licensePlate: "川Z76SB7", time: "2024-09-21 10:30:00" },
  { type: "疑似无计划", licensePlate: "川Z76SB8", time: "2024-09-21 10:31:00" },
  { type: "防拆卸告警", licensePlate: "川Z76SB9", time: "2024-09-21 10:32:00" }
])
</script>

<style lang="scss" scoped>
.alarm-table {
  width: 100%;
  height: 100%;
  padding: 12px 18px;
  .table-header {
    height: 20px;
    display: flex;
    align-items: center;
    font-family: AlibabaPuHuiTi20;
    font-weight: 600;
    font-size: 14px;
    color: #59afed;
    line-height: 20px;
    div {
      text-align: center;
    }
  }
  .table-body {
    width: 100%;
    height: 278px;
    overflow: auto;
  }

  .table-row {
    display: flex;
    align-items: center;
    height: 36px;
    line-height: 36px;
    font-family: AlibabaPuHuiTi20;
    font-weight: normal;
    font-size: 14px;
    color: #d0d5dd;
    &:nth-child(odd) {
      background-image: url("../../../assets/images/bgc-row.png");
      background-size: 100% 100%;
      background-repeat: no-repeat;
    }
    div {
      text-align: center;
      line-height: 36px;
    }
  }
}
.table-body::-webkit-scrollbar {
  width: 2px; /* 滚动条宽度 */
}

.table-body::-webkit-scrollbar-track {
  background: #f1f1f1; /* 滚动条背景 */
  border-radius: 5px; /* 滚动条背景的圆角 */
}

.table-body::-webkit-scrollbar-thumb {
  background: #59afed; /* 滚动条滑块颜色 */
  border-radius: 5px; /* 滚动条滑块的圆角 */
}

.table-body::-webkit-scrollbar-thumb:hover {
  background: #007acc; /* 滚动条滑块悬停时的颜色 */
}
</style>
